package end.handler.comet;

import org.comet4j.core.CometContext;
import org.comet4j.core.CometEngine;

import end.constant.Const;
import end.util.DateUtils;

/**
 * 
 * ClientNormal 上午10:54:49 Copyright zhaocj Inc. All rights reserved. Love Me
 * Like Love Justin Bieber
 * 
 */
public class ClientNormal implements Runnable {
	@Override
	public void run() {
		while (true) {
			try {
				Thread.sleep(1000);
				CometEngine engine = CometContext.getInstance().getEngine();
				engine.sendToAll(Const.COMET_CHANNEL_ANNOUNCES_STATUS,
						DateUtils.getDate("yyyy/MM/dd HH:mm:ss"));
				engine.sendToAll(Const.COMET_CHANNEL_SERVER_FLAG, "1");
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

}
